<!DOCTYPE html>
<html lang="en" >
<head>
	<meta charset="UTF-8">
	<meta http-equiv="Pragma" contect="no-cache">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
	<title>衡阳师院快乐购</title>
	<link rel="stylesheet"  type="text/css" href="css/common.css"/>
	
	<link rel="stylesheet" type="text/css" href="lib/css/ionic.min.css"/>
	<link rel="stylesheet"  type="text/css" href="css/home.css"/>
	<link rel="stylesheet" type="text/css" href="js/swiper-3.4.0.min.css"/>
	<link rel="stylesheet" type="text/css" href="node_modules/cropperjs/dist/cropper.min.css"/>
</head>
<body ng-app="myapp">
	
	
	<ion-nav-view>
	</ion-nav-view>
	

	<script type="text/javascript" src="node_modules/cropperjs/dist/cropper.min.js"></script>
	<script type="text/javascript" src="js/jquery-1.10.2.min.js"/></script>
	<script type="text/javascript" src="js/jquery.idcode.js"/></script>
	<script type="text/javascript" src="lib/js/ionic.bundle.min.js"></script>
	<script type="text/javascript" src="js/zepto.js"></script>
	<script type="text/javascript" src="js/swiper-3.4.0.min.js"></script>
	<script type="text/javascript" src="js/iscroll.js"></script>
	<!-- <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script> -->
	<script type="text/javascript">



	
	
	var app=angular.module("myapp",['ionic','myController','myController1','myController2','myController3','myController4','myController5']);
	app.config(['$stateProvider','$urlRouterProvider','$httpProvider',function($stateProvider,$urlRouterProvider,$httpProvider){
		$httpProvider.defaults.headers.put['Content-Type'] = 'application/x-www-form-urlencoded';
		$stateProvider
		.state('main',{
			abstract:true,
			templateUrl:'view/main.html',
			
			
		})
		.state('main.home',{


			url:'/home',
			cache:false,
			views:{
				'main':{
					templateUrl:'view/home.html',
					controller:'homeCtrl'
				}
			}
		}).state('main.fl',{
			url:"/fl",
			cache:false,
			views:{
				'main':{
					templateUrl:'view/fl.html',
					controller:'flCtrl'
				}
			}
		}).state('main.login',{
			url:"/login",
			views:{
				'main':{
					templateUrl:'view/login.html',
					controller:'loginCtrl'
				}
			}
		}).state('main.search',{
			url:"/search",
			views:{
				'main':{
					templateUrl:'view/search.html',
					controller:'searchCtrl'
				}
			}
		}).state('main.register',{
			url:'/register',
			views:{
				'main':{
					templateUrl:'view/register.html',
					controller:'registerCtrl'
				}
			}
		}).state('main.detail',{
			url:'/detail',
			cache:false,
			views:{
				'main':{
					templateUrl:'view/detail.html',
					controller:'detailCtrl'
				}
			}
		}).state('main.car',{
			url:'/car',
			cache:false,
			views:{
				'main':{
					templateUrl:'view/car.html',
					controller:'carCtrl'
				}
			}
		}).state('main.user',{
			url:'/user',
			cache:false,
			views:{
				'main':{
					templateUrl:'view/user.html',
					controller:'userCtrl'
				}
			}
		}).state('main.find_pwd',{
			url:'/find_pwd',
			cache:false,
			views:{
				'main':{
					templateUrl:'view/find_pwd.html',
					controller:'findPwdCtrl'
				}
			}
		})

		$urlRouterProvider.otherwise("/home");
	}]).run(function($rootScope,$http){
	
	
		$rootScope.freeLogin=function(callback){
			var localsorageInfo=JSON.parse(localStorage.getItem("JDlogin_user"));
			console.log(localsorageInfo);
			if(!localsorageInfo||!localsorageInfo.user)
			{
				callback();
				return;
			}
			var data_user = {
				user:localsorageInfo.user,
				pwd:localsorageInfo.pwd
			},
			//post请求的地址
			url = "login.php",
			//将参数传递的方式改成form
			postCfg = {
			headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
			transformRequest: function (data) {
			return $.param(data);
			}
			};
			//发送post请求，获取数据
			$http.post(url, data_user, postCfg).success(function(res,status){
				console.log(res);
				$rootScope.admin_user=data_user.user;
				callback();
			}).error(function(res,status){
				console.log(res);
			})
		}
		// $rootScope.freeLogin();
	})






		function resize() {
			var clientwidth=document.documentElement.clientWidth;
			document.documentElement.style.fontSize=100*(clientwidth/320)+'px';
			
		}
		resize();
		window.addEventListener('resize',resize);


		// angular.module("myapp",['ionic']).controller('dvctrl',["$scope",function($scope){}]);
	</script>
	
	<script type="text/javascript" src="node_modules/exif-js/exif.js"></script>
	<script type="text/javascript" src="js/move.js"></script>
	<script type="text/javascript" src="controller/home.js"></script>
	<script type="text/javascript" src="controller/list.js"></script>
	<script type="text/javascript" src="controller/detail.js"></script>
	<script type="text/javascript" src="controller/user.js"></script>
	<script type="text/javascript" src="controller/car.js"></script>
	<script type="text/javascript" src="controller/find_pwd.js"></script>
</body>
</html>